#pragma once



template<class K>
class Set
{
public:
	struct KeyOfT
	{
		const K& operator()(const K& date)
		{
			return date;
		}
	};
	typedef typename RBTree<K, K, KeyOfT>::const_iterator iterator;
	typedef typename RBTree<K, K, KeyOfT>::const_iterator const_iterator;

	
	iterator begin()
	{
		return _t.begin();
	}

	iterator end()
	{
		return _t.end();
	}
	pair<iterator, bool> insert(const K& key)
	{
		return _t.Insert(key);
	}

private:
	RBTree<K, K, KeyOfT> _t;


};

void test_set1()
{
	int a[] = { 16, 3, 7, 11, 9, 26, 18, 14, 15 };
	Set<int> s;
	for (auto e : a)
	{
		s.insert(e);
	}

	Set<int>::iterator it = s.begin();
	while (it != s.end())
	{
		cout << *it << " ";
		//*it = 1;

		++it;
	}
	cout << endl;

	for (auto e : s)
	{
		cout << e << " ";
	}
	cout << endl;
}